// 封装新闻相关的接口

import axios from "@/utils/request";

// 获取新闻列表接口
export function getNewsList(params){
    return axios({
        url: "/post",
        method: "get",
        params,
        // headers:{
        //     Authorization: localStorage.getItem("token-70")
        // }
    })
}

// 新闻文章详情接口
export function articleDetail(id){
    return axios({
        url: "/post/"+id,
        method: "get"
    })
}

// 获取文章评论列表/post_comment/:id,传文章id
export function post_comment(id){
    return axios({
        url: "/post_comment/"+id,
        method: "get"
    })
}

// 发表文章评论
export function publisher(id,data){
    return axios({
        url: "/post_comment/"+id,
        method: "post",
        data
    })
}

// 搜索文章接口
export function post_search(params){
    return axios({
        url: "/post_search",
        method: "get",
        params
    })
}